﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EnvSafe.Expression;

namespace Heroius.DBTransitor
{
    internal class Step3Helper
    {
        internal static Interpreter Maker;

        internal static OperatorFactory Fac;

        static Step3Helper()
        {
            Fac = new OperatorFactory(typeof(MyOperators));
            Maker = new Interpreter(Fac);

            Maker.RegistSymbol("+", 2, 0, "ADDITION");
            Maker.RegistSymbol("-", 2, 0, "SUBTRACTION");
            Maker.RegistSymbol("-", 1, 2, "MINUS");
            Maker.RegistSymbol("*", 2, 1, "MULTIPLICATION");
            Maker.RegistSymbol("/", 2, 1, "DIVISION");
            Maker.RegistSymbol("^", 2, 1, "POW");
            Maker.RegistSymbol(">", 2, -1, "GT");
            Maker.RegistSymbol("<", 2, -1, "LT");
            Maker.RegistSymbol("=", 2, -1, "EQ");
            Maker.RegistSymbol("&", 2, -2, "AND");
            Maker.RegistSymbol("|", 2, -2, "OR");
            Maker.RegistSymbol(">=", 2, -1, "GE");
            Maker.RegistSymbol("<=", 2, -1, "LE");
            Maker.RegistSymbol("!=", 2, -1, "NE");
        }

        internal static string EncodeUserVar(string Name)
        {
            return "_" + Name;
        }

        internal static string DecodeUserVar(string Name)
        {
            return Name.Substring(1);
        }
    }

    public static class MyOperators
    {
        
    }
}
